/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package business;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;

/**
*
* @author atikahSH
*/
@Entity
public class Order implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long idOrder;
    private String user;
    private int kuantitas;
    private String obat;

    @Temporal(javax.persistence.TemporalType.DATE)
    private Date orderdate;

    public Order() {
    }

     public Order(Long idOrder) {
        this.idOrder = idOrder;
    }

    public Order(Long idOrder, String user, String obat, int kuantitas ) {
        this.idOrder = idOrder;
        this.user = user;
        this.obat = obat;
        this.kuantitas = kuantitas;
    }

    public Long getid() {
        return idOrder;
    }

    public void setid(Long idOrder) {
        this.idOrder = idOrder;
    }

    public String getUser() {
        return user;
    }

    public void setUser(Object user) {
        this.user = (String) user;
    }

    /*public void setMembers(members members) {
        this.members = members;
    }*/

    public String getObat() {
        return obat;
    }

     public void setObat(String obat) {
        this.obat = obat;
    }

    public int getKuantitas() {
        return kuantitas;
    }

    public void setKuantitas(int kuantitas) {
        this.kuantitas = kuantitas;
    }

    public Date getorderdate() {
        return orderdate;
    }

    public void setorderdate(Date orderdate) {
        this.orderdate = orderdate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idOrder != null ? idOrder.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Order)) {
            return false;
        }
        Order other = (Order) object;
        if ((this.idOrder == null && other.idOrder != null) || (this.idOrder != null && !this.idOrder.equals(other.idOrder))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "business.Order[idOrder=" + idOrder + "]";
    }

}

